<!DOCTYPE html>
<html lang="en"xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  <meta name="description" content="">
  <meta name="author" content="ThemeBucket">
  <link rel="shortcut icon" href="#" type="image/png">

  <title>Dynamic Table</title>

  <!--dynamic table-->
  <link href="js/advanced-datatable/css/demo_page.css" rel="stylesheet" />
  <link href="js/advanced-datatable/css/demo_table.css" rel="stylesheet" />
  <link rel="stylesheet" href="js/data-tables/DT_bootstrap.css" />

    <div th:replace="common::#commonHead"></div>
</head>

<body class="sticky-header">

<section>
    <!-- left side start-->
    <div th:replace="common::#commonLeftMenu"></div>
    <!-- left side end-->
    
    <!-- main content start-->
    <div class="main-content" >

        <!-- header section start-->
        <div th:replace="common::#commonHeaderMenu"></div>
        <!-- header section end-->

        <!-- page heading start-->
        <div class="page-heading">
            <h3>
                Dynamic Table
            </h3>
            <ul class="breadcrumb">
                <li>
                    <a href="#">Dashboard</a>
                </li>
                <li>
                    <a href="#">Data Tables</a>
                </li>
                <li class="active"> Dynamic Table </li>
            </ul>
        </div>
        <!-- page heading end-->

        <!--body wrapper start-->
        <div class="wrapper">
        <div class="row">
        <div class="col-sm-12">
        <section class="panel">
        <header class="panel-heading">
            Dynamic Table
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <a href="javascript:;" class="fa fa-times"></a>
             </span>
        </header>
        <div class="panel-body">
        <div class="adv-table">
        <table  class="display table table-bordered table-striped" id="dynamic-table">
        <thead>
        <tr>
            <td>#</td>
            <td>用户名</td>
            <td>年龄</td>
            <td>邮箱</td>
        </tr>
        </thead>
        <tbody>
        <tr class="gradeX" th:each="user,id:${page.getRecords()}">
            <td>[[${id.index+1}]]</td>
            <td th:text="${user.name}"></td>
            <td th:text="${user.age}"></td>
            <td th:text="${user.email}"></td>
            <td><a th:href="@{/delete(id=${id.count},pg=${page.getCurrent()})}">删除</a></td>
        </tr>
        <tfoot>
        <tr>
            <td>#</td>
            <td>用户名</td>
            <td>年龄</td>
            <td>邮箱</td>
        </tr>
        </tfoot>
        </table>
            <div class="row-fluid">
                <div class="span6">
                    <div class="dataTables_info" id="dynamic-table_info">Showing [[${page.current}]] to [[${page.pages}]] of [[${page.total}]] entries</div>
                </div>
                <div class="span6">
                    <div class="dataTables_paginate paging_bootstrap pagination">
                        <ul>
                            <li class="prev disabled"><a th:href="@{/dynamicTable(pg=${page.getCurrent()-1})}">← Previous</a></li>
                            <li class="active" th:each="pg:${#numbers.sequence(1,page.pages)}"><a th:href="@{/dynamicTable(pg=${pg})}">[[${pg}]]</a></li>
                            <li class="next disabled"><a href="#">Next → </a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        </div>
        </section>
        </div>
        </div>
        <div class="row">
        <div class="col-sm-12">
        <section class="panel">
        <header class="panel-heading">
            DataTables hidden row details example
            <span class="tools pull-right">
                <a href="javascript:;" class="fa fa-chevron-down"></a>
                <a href="javascript:;" class="fa fa-times"></a>
             </span>
        </header>

        </section>
        </div>
        </div>
        </div>
        <!--body wrapper end-->

        <!--footer section start-->
        <footer>
            2014 &copy; AdminEx by ThemeBucket
        </footer>
        <!--footer section end-->


    </div>
    <!-- main content end-->
</section>

<div th:replace="common::#commonScript"></div>

<!--dynamic table-->
<script type="text/javascript" language="javascript" src="js/advanced-datatable/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="js/data-tables/DT_bootstrap.js"></script>
<!--dynamic table initialization -->
<!--<script src="js/dynamic_table_init.js"></script>-->


</body>
</html>
